<template>
 <a class="weui-media-box weui-media-box_appmsg" v-on:click.stop = "go" >
    <div class="weui-media-box__hd">
        <img class="weui-media-box__thumb" v-bind:src="item.images.medium" alt="">
    </div>
    <div class="weui-media-box__bd">
        <h4 class="weui-media-box__title">{{item.title}}</h4>
        <p class="weui-media-box__desc">
                <div class="desc">{{item.original_title}}({{item.year}})</div>
                <div class="desc">{{item.directors[0].name}}</div>
        </p>
    </div>
    <div class="weui-media-box__bd rating" style="flex;0.2">
            {{item.rating.average}}
    </div>
</a>
</template>

<script> 
import routes from '../routes'

export default{
      props : ['item','href'],
	data () {
		return {

		}
	},
       methods : {
            go (event){ 
                    console.log(this.href);
                    window.history.pushState(
                      null,
                      routes[this.href],
                      this.href
                    )
                    this.$root.currentRoute = this.href
            }
       }
}
</script>

<style> 
/* wechat default css */ 
.desc {
  font-size: 14px;
  color: gray;
}
.rating{  
  text-align: right;
  font-size: 13px;
  font-weight: bold;
  color: red;
}
</style>